home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2528 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  56 lines

  1. Path: ra.nrl.navy.mil!usenet
  2. From: dyer@alx.sticomet.com (Doug Dyer)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: MatchFirst->Lock->Examine->ExAll = Enforcer (Help! :)
  5. Date: 29 Jan 1996 19:12:08 GMT
  6. Organization: Naval Research Laboratory
  7. Message-ID: <4ej668$f7u@ra.nrl.navy.mil>
  8. NNTP-Posting-Host: tgdp00.nrl.navy.mil
  9. X-Newsreader: NN version 6.5.0 CURRENT #10
  10.  
  11. Hi folks, 
  12.  
  13. I am trying to write a program that will, given an amigados
  14. pattern, recursively descend directories and perform some
  15. action on each file.  
  16.  
  17. Im having a problem with an enforcer hit in ExAll() and Im
  18. not sure why, so I thought Id post here with a synopsis
  19. of the algorithm in case Im doing something "amiga-illegal".
  20.  
  21. Any example code anyone can supply would be great! (or insights!)
  22. thanks,
  23. Doug
  24.  
  25. ... main .......
  26. main()
  27. if (MatchFirst()) {
  28.     do {
  29.         handlePath(pathname)
  30.     } while (MatchNext())
  31.  
  32. .... handlePath ...
  33.  
  34. handlePath(pathname)
  35.     lock (path, ACCESS_WRITE)
  36.  
  37.     Examine (path)
  38.     if (path is a directory)
  39.         EnterDirectory(lock, pathname);
  40.     else (do specific file thingie)
  41.  
  42.     unlock(path)
  43.  
  44. .... enterDirectory ....
  45.  
  46.  
  47.     get the dos object, 
  48.     use allocmem for alignment
  49.     ExAll
  50.         for each ExAllEntry, handlePath
  51.             
  52. --
  53. Doug Dyer - dyer@alx.sticomet.com | ECL: embedded command language
  54. STI: voice (703) 329-9707         |      for the 8051 family
  55.                    These opinions are yours
  56.